package app.texas.com.devilfishhouse.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import app.texas.com.devilfishhouse.myUtils.WLogger;


/**
 * Created by solin on 2017/6/14.
 */

public class UiHelper {
    /**
     * 启动通用activity
     *
     * @param context 上下文
     * @param page    枚举类对象
     * @param args    bundle
     */
    public static void shoSimpleBack(Context context, SimpleBackPage page, Bundle args) {
        Intent intent = new Intent(context, SimpleBackActivity.class);
        intent.putExtra(SimpleBackActivity.BUNDLE_KEY_ARGS, args);
        WLogger.log("page=" + page.getValue());
        intent.putExtra(SimpleBackActivity.BUNDLE_KEY_PAGE, page.getValue());
        context.startActivity(intent);
    }
    public static void shoSimpleBackNew(Context context, SimpleBackPage page, Bundle args) {
        Intent intent = new Intent(context, SimpleBackActivity.class);
        intent.putExtra(SimpleBackActivity.BUNDLE_KEY_ARGS, args);
        WLogger.log("page=" + page.getValue());
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP );
        intent.putExtra(SimpleBackActivity.BUNDLE_KEY_PAGE, page.getValue());
        context.startActivity(intent);
    }
    /**
     * 打开我的设置页面
     *
     * @param context
     */
    public static void showSetting(Context context) {
        Bundle bundle = new Bundle();
//        shoSimpleBack(context, SimpleBackPage.USER_SETTING, bundle);
    }


}
